package wnhz.com.business.freeshop.activity.fourthfree;

import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.WindowManager;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import wnhz.com.business.R;
import wnhz.com.business.base.BaseActivity;
import wnhz.com.business.base.BaseRVAdapter;
import wnhz.com.business.base.BaseViewHolder;
import wnhz.com.business.impl.ActionBarClickListener;
import wnhz.com.business.view.TranslucentActionBar;
import wnhz.com.business.view.TranslucentActionBarW;

/**
 *
 */
public class JiaoYiRecordActivity extends BaseActivity implements ActionBarClickListener {

    @BindView(R.id.actionbar)
    TranslucentActionBarW actionbar;
    @BindView(R.id.recycler_record)
    RecyclerView recyclerRecord;

    private List<String> itemdata = new ArrayList<>();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_jiao_yi_record_f);
        ButterKnife.bind(this);

        actionbar.setData("使用记录", R.drawable.ic_left_back, null, 0, null,0, this);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
            this.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
            //改变状态栏颜色
            this.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
            actionbar.setStatusBarHeight(getStatusBarHeight());
        }

        initview();
        setrecyclerRecord();

    }

    public static Intent createIntent(Context context) {
        Intent intent = new Intent(context, JiaoYiRecordActivity.class);
        return intent;
    }

    private void initview()
    {

        itemdata.clear();
        for (int i = 0; i < 6; i++) {
            itemdata .add("te"+i);
        }

        recyclerRecord.setLayoutManager(new LinearLayoutManager(this,LinearLayoutManager.VERTICAL,false));
    }

    private void setrecyclerRecord()
    {
        recyclerRecord.setAdapter(new BaseRVAdapter(this,itemdata) {
            @Override
            public int getLayoutId(int viewType) {
                return R.layout.item_jiaoyirecord;
            }

            @Override
            public void onBind(BaseViewHolder holder, int position) {

            }

        });
    }

    @Override
    public void onLeftClick() {
            finish();
    }

    @Override
    public void onRightClick() {

    }

    @Override
    public void onEditTextClick() {

    }
}
